import React, {Suspense} from 'react';
import {Navigate, Route, Routes} from "react-router-dom";
import {Skeleton} from "antd";
import routerConf from "@/routerConf";

function RouterDOM() {
    return <Suspense fallback={<>
        <Skeleton active/>
        <Skeleton active/>
        <Skeleton active/>
        <Skeleton active/>
    </>}>
        <Routes>
            <Route path="/" element={<Navigate to="/vip/cdk" replace />} />

            {
                routerConf.map((item) => <Route key={item.path} path={item.path} element={<item.ele/>}/>)
            }
        </Routes>
    </Suspense>
}
function App(props) {
    return (
        <div style={{width:"100vw",height:"100vh",overflow:"hidden"}}>
            <RouterDOM/>
        </div>
    );
}

export default App;